]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: split out a function
authorCosimo Cecchi <cosimo@endlessm.com>
Tue, 24 May 2016 18:55:13 +0000 (11:55 -0700)
committerCosimo Cecchi <cosimo@endlessm.com>
Fri, 27 May 2016 17:46:58 +0000 (10:46 -0700)
We're going to use this in a later commit.

https://bugzilla.gnome.org/show_bug.cgi?id=766826

js/ui/status/keyboard.js

index d357258ded681fa7ac0e746f89cb922acc3f6d81..895b73c0762432fed4474268a19e15d66c599d40 100644 (file)
@@ -261,9 +261,9 @@ const InputSourceSessionSettings = new Lang.Class({
         this._settings.connect('changed::' + this._KEY_PER_WINDOW, Lang.bind(this, this._emitPerWindowChanged));
     },
 
-    get inputSources() {
+    _getSourcesList: function(key) {
         let sourcesList = [];
-        let sources = this._settings.get_value(this._KEY_INPUT_SOURCES);
+        let sources = this._settings.get_value(key);
         let nSources = sources.n_children();
 
         for (let i = 0; i < nSources; i++) {
@@ -273,6 +273,10 @@ const InputSourceSessionSettings = new Lang.Class({
         return sourcesList;
     },
 
+    get inputSources() {
+        return this._getSourcesList(this._KEY_INPUT_SOURCES);
+    },
+
     get keyboardOptions() {
         return this._settings.get_strv(this._KEY_KEYBOARD_OPTIONS);
     },